package com.app.controller;

import com.app.entity.AppCategory;
import com.app.service.Appcategory.AppcategoryService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
@RequestMapping("/appcategory")
public class AppcategoryController {
    private Logger logger= Logger.getLogger(AppcategoryController.class);
    @Autowired
    private AppcategoryService appcategoryService;

    @ResponseBody
    @RequestMapping(value = "/Xiala",method = RequestMethod.GET)
    public List<AppCategory> xiala(@RequestParam Integer id, HttpServletRequest request, Model model){
        List<AppCategory> appCategoryList=appcategoryService.AppCate(id);
        model.addAttribute("appCategoryList",appCategoryList);
        System.out.println(appCategoryList+"-----------------------------------------------appCategoryList");
        return appCategoryList;
    }

}
